package com.example.infowall02.service;

import com.example.infowall02.domain.Articles;

import java.util.List;

public interface ArticlesService {
    //增
    Articles addArticle(Articles article);
    //改
    int incrementLikes(int id);
    int incrementClicks(int id);
    int incrementFavorites(int id);
    //删
    boolean deleteArticleById(int id);
    //查
    List<Articles> findArticlesByKeyword(String keyword, int pageNow, int pageSize);
    List<Articles> findArticlesByType(String type,int pageNow, int pageSize);
    List<Articles> findRecommendArticlesByTime();
    List<Articles> findRecommendArticlesByClicks();

    Articles findArticleById(int id);
    boolean updateArticleInfo(Articles article,int id);

    int countArticlesByKeyword(String keyword);
    int countArticlesByType(String type);
}
